package com.example.MovieRecommenderSystem.lesson10;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@ComponentScan(basePackages = "com.example.MovieRecommenderSystem.lesson10")
@ComponentScan(includeFilters = @ComponentScan.Filter(
        type= FilterType.REGEX,
        pattern = "com.example.MovieRecommenderSystem.lesson9.*")
)
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class CollaborativeFilter implements Filter {

    public CollaborativeFilter() {
        super();
        System.out.println("collaborative filter constructor called");
    }

    public String[] getRecommendations(String movie) {

        return new String[] {"Finding Nemo", "Ice Age", "Toy Story"};
    }
}